package com.fsc.handler;

import com.fsc._enum.ReturnEnum;
import lombok.Getter;

/**
 * 自定义异常
 */
@Getter
public class BusinessException extends RuntimeException {

    //状态码
    private Integer code;

    public BusinessException(ReturnEnum returnEnum) {
        super(returnEnum.getMessage());
        this.code = returnEnum.getCode();
    }
    public BusinessException(ReturnEnum returnEnum, Throwable cause) {
        super(returnEnum.getMessage(),cause);
        this.code = returnEnum.getCode();
    }
}